﻿Imports System.Activities
Imports System.Activities.Presentation.Metadata
Imports System.ComponentModel
Imports System.Drawing
Imports System.Activities.Presentation

Public Class WMISYSGetDesktopMonitor
    Inherits WMIExecuteActivityBase


    Public Sub New()
        Me.DisplayName = My.Resources.GetDesktopMonitorDisplayName
    End Sub

    Protected Overrides Function BeginExecute(ByVal context As AsyncCodeActivityContext, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult
        MyBase._target = "Win32_DesktopMonitor"
        MyBase._where = ""
        MyBase._service = "cimv2"
        Return MyBase.BeginExecute(context, callback, state)
    End Function

    Protected Overrides Sub CacheMetadata(metadata As CodeActivityMetadata)
        MyBase.CacheMetadata(metadata)

        Dim build As New AttributeTableBuilder
        'WMISYSGetDesktopMonitor Activity
        build.AddCustomAttributes(Me.GetType,
                                      New DesignerAttribute(GetType(WMIDefaultActivityDesigner), GetType(ActivityDesigner)),
                                      New ToolboxBitmapAttribute(Me.GetType, "WmiDefault.png"))

        MetadataStore.AddAttributeTable(build.CreateTable)
    End Sub

End Class
